/*
 * @Author: 230800029 rixing.liu@hytera.com
 * @Date: 2024-04-19 09:29:32
 * @LastEditors: 230800029 rixing.liu@hytera.com
 * @LastEditTime: 2024-04-19 13:17:04
 * @FilePath: /vue3-pg/src/rotuer/index.ts
 * @Description: 
 * Copyright (c) 2024 by rixing.liu, All Rights Reserved.
 */
import { createRouter, createWebHashHistory } from 'vue-router';
import NProgress from 'nprogress'; // progress bar
import 'nprogress/nprogress.css';

import { appRoutes } from './routes';
import { REDIRECT_MAIN, NOT_FOUND_ROUTE } from './routes/base';

NProgress.configure({ showSpinner: false }); // NProgress Configuration

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: 'index',
    },
    ...appRoutes,
    REDIRECT_MAIN,
    NOT_FOUND_ROUTE,
  ],
  scrollBehavior() {
    return { top: 0 };
  },
});


export default router;